export default {
  methods: {
    menuChange(menu) {
      let path = menu.path;
      if (path === '') {
        return;
      }

      location.href = path;
    },

    toPage(path, hasNav = false) {
      if (hasNav) {
        window.open(path);
      } else {
        location.href = path;
      }
    },

    toMainPage() {
      let pages = getCurrentPages();
      if (pages.length > 1) {
        wx.navigateBack();
      } else {
        location.href = '/home';
      }
    }
  }
}
